import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
	state: {
		
		unReadCounts: 0,
	},
	mutations: {
		showCount(state, count) {
			state.unReadCounts = count;
			if(Number(count)){
				uni.showTabBarRedDot({index:4});
			}else{
				uni.hideTabBarRedDot({index:4});
			}
		},
		emptyCount(state) {
		
			state.unReadCounts = 0

			uni.hideTabBarRedDot({index:4});
			
		}
	},
	actions: {
	
	}
})

export default store